﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Gerador
{
    public class EnvironmentConfigurationSection : ConfigurationSection
    {
        [ConfigurationProperty("xpaths", IsRequired = true)]
        [ConfigurationCollection(typeof(XPathsElement), AddItemName = "xpath")]
        public ConfigurationCollection<XPathsElement> Xpaths
        {
            get
            {
                return (ConfigurationCollection<XPathsElement>)this["xpaths"];
            }
        }

        [ConfigurationProperty("files", IsRequired = true)]
        [ConfigurationCollection(typeof(FileConfigurationElement), AddItemName = "add")]
        public ConfigurationCollection<FileConfigurationElement> Files
        {
            get
            {
                return (ConfigurationCollection<FileConfigurationElement>)this["files"];
            }
        }

        public static EnvironmentConfigurationSection GetSection()
        {
            return (EnvironmentConfigurationSection)ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).GetSection("environmentConfiguration");
        }
    }
}
